#include<bits/stdc++.h>

using namespace std;

vector<int> Ti(11);
vector<int> Di(11);
vector<int> Li(11);
bool vis[11];
int n;
int flag;


void dfs(int cnt, int time)
{
	if (cnt == n)
	{
		flag = 1;
		return;
	}

	for (int i = 0; i < n; i++)
	{
		if (!vis[i] && time <= Ti[i] + Di[i])
		{
			vis[i] = true;
			dfs(cnt + 1, max(time + Li[i], Ti[i] + Li[i]));
			vis[i] = false;
		}
	}
}

int main()
{
	int t;
	cin >> t;
	while (t--)
	{
		flag = 0;
		cin >> n;
		for (int i = 0; i < n; i++)
		{
			cin >> Ti[i] >> Di[i] >> Li[i];
		}

		dfs(0, 0);

		if (flag)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}

	return 0;
}